<?php

namespace App\Http\Controllers\Wx;

use EasyWeChat\Foundation\Application;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;

class Controller extends BaseController
{
    use AuthorizesRequests, DispatchesJobs, ValidatesRequests;


    protected function member() {
        return session('member');
    }

    protected function wechatUserInfo() {
        $wechat = app(Application::class);
        $member = $this->member();
        $wechatUserInfo = $wechat->user->get($member->openid);
        return $wechatUserInfo;
    }
}
